import React, { Component, } from 'react';

// 引入propTypes   props校验组件,注意是小驼峰


class sonDemo extends Component {
    constructor(props) {
        super(props);
        this.state = {
            name:''
        }
    }
    componentDidMount(){
        
    }
    sonFun(e){
        this.setState({
            name:'六道'
        })
        console.log('这是从父组件传递过来的参数',this);
    }
    
    render() { 
        console.log('子组件更新了');
        return (
            <div>
                <p>这是子组件</p>
            </div>
        );
    }
}
export default sonDemo;

